package com.ruoyi.experiment.mapper;

import com.ruoyi.experiment.domain.Circulation;
import com.ruoyi.experiment.domain.Experiment;
import com.ruoyi.experiment.domain.Project;
import com.ruoyi.experiment.domain.Sample;
import com.ruoyi.experiment.model.EProject;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
@Mapper
public interface ExperimentMapper {
    List<Long> selectNoFlumeExperiments(Long id);
    List<Long> selectNoFlumeProjects(Long id);
    List<EProject> selectAllItem(Project project);

    List<Sample> selectSamples(Sample sample);

    boolean insertMsg(@Param("postId") int postId, @Param("projectId") long projectId,
                      @Param("userId") long userId, @Param("msg") String msg);
    boolean updateSample(Sample sample);

    /**
     * 流转
     * @param id
     * @param expermentType
     * @return
     */
    boolean flumeExperiment(@Param("id") Long id,@Param("expermentType") Integer expermentType);

    boolean insertFlume(Circulation circulation);

    /**
     * 查询实验管理
     *
     * @param sampleId 实验管理主键
     * @return 实验管理
     */
    public Experiment selectExperimentalBySampleId(Long sampleId);

    public Experiment selectExperimentalManagementByExperimentId(Long experimentId);
    /**
     * 查询实验管理列表
     *
     * @param experimentalManagement 实验管理
     * @return 实验管理集合
     */
    public List<Experiment> selectExperimentalManagementList(Experiment experimentalManagement);

    /**
     * 新增实验管理
     *
     * @param experimentalManagement 实验管理
     * @return 结果
     */
    public int insertExperimentalManagement(Experiment experimentalManagement);

    /**
     * 修改实验管理
     *
     * @param experimentalManagement 实验管理
     * @return 结果
     */
    public int updateExperimentalManagement(Experiment experimentalManagement);

    /**
     * 删除实验管理
     *
     * @param sampleId 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteExperimentalManagementBySampleId(Long sampleId);

    void updateProject(Long id);

    void updateAmount(Long pid);

    Long selectProjectId(Long sid);

    List<Sample> selectSamplesByExperimentId(Long[] ids);

    Sample selectSampleById(Long id);
}
